<?php


namespace app\app\model;
use think\Model;

class Board extends Model
{
    public function getCreateTimeAttr($value)
    {
        return date('Y-m-d H:i:s',$value);
    }

    //BkTime
    public function getBkTimeAttr($value)
    {
        if ($value){
            return date('Y-m-d H:i:s',$value);
        }else{
            return '';
        }
    }

    //hb_time
    public function getHbTimeAttr($value)
    {
        if ($value){
            return date('Y-m-d H:i:s',$value);
        }else{
            return '';
        }
    }

    //JhTime
    public function getJhTimeAttr($value)
    {
        if ($value){
            return date('Y-m-d H:i:s',$value);
        }else{
            return '';
        }
    }

    //获取状态
    public function getStatusAttr($value)
    {
        //status 0未激活 1已激活
        $status=[
            0=>array(
                'value'=>$value,
                'text'=>'未开卡',
                'color_text'=>'rgba(245, 137, 21, 1)',
                'color_bg'=>'rgba(245, 137, 21, 0.10)',
            ),
            1=>array(
                'value'=>$value,
                'text'=>'已开卡',
                'color_text'=>'rgba(33, 190, 144, 1)',
                'color_bg'=>'rgba(33, 190, 144, 0.10)',
            )
        ];
        return $status[$value];
    }
}